import { ref } from "vue"
export const useNavBar = () => {
  const list = ref(["工具箱", "事件", "公告", "我的"])
  // 控制选中项变色
  const flag = ref(null)
  // 控制工具箱弹出
  const toolShow = ref(false)
  function showTool() {
    toolShow.value = true
  }
  //关闭工具箱
  function closeTool() {
    toolShow.value = false
  }
  //控制事件弹出
  const eventShow = ref(false)
  function showEvent() {
    eventShow.value = true
  }
  //关闭事件弹窗
  function closeEvent() {
    eventShow.value = false
  }
  //控制我的弹出
  const userShow = ref(false)
  function showUser() {
    userShow.value = true
  }
  //关闭事件弹窗
  function closeUser() {
    userShow.value = false
  }
  //打开公告弹窗
  // 控制公告显示
  const noticeShow = ref(false)
  function showNotice() {
    noticeShow.value = true
  }
  //关闭公告弹窗
  function closeNotice() {
    noticeShow.value = false
  }
  return {
    showTool,
    toolShow,
    closeTool,
    showEvent,
    eventShow,
    closeEvent,
    showUser,
    userShow,
    closeUser,
    showNotice,
    noticeShow,
    closeNotice,
  }
}
